package org.komarichin.struts2.actions.search;

import org.komarichin.google.search.ResponseData;
import org.komarichin.struts2.BaseAction;

/**
 * User: Mykhaylo Komarichyn
 * Date: 28.01.2010
 * Time: 11:00:36
 */
public class SearchAction extends BaseAction {
    private static final long serialVersionUID = -1501662153840489935L;

    private ResponseData data;
    private String search;
    private long start = 0;

    @Override
    public String execute() throws Exception {

        data = getGoogleService().getResultByQuery(search, "www.jdsm.org", start);

        return SUCCESS;
    }

    public boolean isDataNotEmpty() {
        return data != null;
    }

    public ResponseData getData() {
        return data;
    }

    public void setData(ResponseData data) {
        this.data = data;
    }

    public String getSearch() {
        return search;
    }

    public void setSearch(String search) {
        this.search = search;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }
}
